package com.retail.member.controller;

import com.retail.core.entity.result.Result;
import com.retail.help.entity.vo.RetailHelpVo;
import com.retail.member.client.HelpClient;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Api(value = "帮助页面API", tags = "帮助页面API")
@RestController
@RequestMapping("api/help")
public class HelpApiController {

    private final HelpClient helpClient;

    public HelpApiController(HelpClient helpClient) {
        this.helpClient = helpClient;
    }

    @ApiOperation("帮助详情")
    @GetMapping("getHelp/{id}")
    public Result<RetailHelpVo> getHelp(@PathVariable("id") Long id) {
        return helpClient.getHelp(id);
    }

    @ApiOperation("帮助列表")
    @GetMapping("findHelps")
    public Result<List<RetailHelpVo>> findHelps() {
        return helpClient.findHelps();
    }

}
